package com.example.pkmedical.Fragments;

import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.pkmedical.APP.MyApp;
import com.example.pkmedical.Activity.help.HelpActivity;
import com.example.pkmedical.Activity.servicecode.InputCodeActivity;
import com.example.pkmedical.Activity.setting.DataChangeActivity;
import com.example.pkmedical.Base.BaseFragment;
import com.example.pkmedical.R;
import com.example.pkmedical.Utils.CommandUtil;

import butterknife.BindView;
import butterknife.OnClick;


public class SettingFragment extends BaseFragment {

    private static final String TAG = "yangshuo";
    @BindView(R.id.setting_story_bt)
    Button settingStoryBt;
    @BindView(R.id.setting_language_bt)
    Button settingLanguageBt;
    @BindView(R.id.setting_date_bt)
    Button settingDateBt;
    @BindView(R.id.setting_servicecode_bt)
    Button settingServicecodeBt;
    @BindView(R.id.setting_icon_bt)
    Button settingIconBt;
    @BindView(R.id.setting_version_bt)
    Button settingVersionBt;
    @BindView(R.id.finish)
    Button finish;
    @BindView(R.id.weight_show_text)
    TextView weight_show_text;
    String one, two, three, four, five;
    byte[] mBytes;
    @BindView(R.id.setting_help_bt)
    Button settingHelpBt;
    @BindView(R.id.setting_100_air)
    Button setting100Air;

    @Override
    public int setLayoutId() {
        return R.layout.fragment_setting;
    }

    @Override
    public void findViewById(View view) {

    }

    @Override
    public void setViewData(View view) {

    }

    @Override
    public void setClickEvent(View view) {

    }

    @OnClick({R.id.setting_help_bt, R.id.setting_story_bt, R.id.setting_language_bt, R.id.setting_date_bt, R.id.setting_servicecode_bt, R.id.setting_icon_bt, R.id.setting_version_bt, R.id.finish, R.id.setting_100_air})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.setting_story_bt:
                break;
            case R.id.setting_language_bt:
                break;
            case R.id.setting_date_bt:
                startActivity(new Intent(MyApp.getAppContext(), DataChangeActivity.class));
                break;
            case R.id.setting_servicecode_bt:
                startActivity(new Intent(MyApp.getAppContext(), InputCodeActivity.class));
//                getActivity().overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
                break;
            case R.id.setting_icon_bt:
//                startActivity(new Intent(MyApp.getAppContext(), ThresholdActivity.class));
                break;
            case R.id.setting_version_bt:
//                TimeUtils.nDateSet(2020,10,1);
//                Toast.makeText(mActivity, "00000", Toast.LENGTH_SHORT).show();
                break;
            case R.id.setting_help_bt:
                startActivity(new Intent(MyApp.getAppContext(), HelpActivity.class));
                break;
            case R.id.finish:
                break;
            case R.id.setting_100_air:
                if (CommandUtil.IS_100_AIR) {
                    CommandUtil.IS_100_AIR = false;
                    setting100Air.setText(R.string.air_type_off);
                    Log.d("yangshuo",CommandUtil.IS_100_AIR+"");
                } else {
                    CommandUtil.IS_100_AIR = true;
                    setting100Air.setText(R.string.air_type_on);
                    Log.d("yangshuo",CommandUtil.IS_100_AIR+"");
                }
                break;
        }
    }
}
